package com.verisette.ncos.persistence.domain;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Transient;

import com.verisette.ncos.common.CommonUtil;

@Entity
@IdClass(CustomMasterUserProfileId.class)
public class CustomMasterUserProfile implements Serializable {
	
	private static final long serialVersionUID = -2061268442188914963L;

	@Id
	@Column(name="USP_ID")
	private Integer uspId;

	@Id
	@Column(name="USG_ID")
	private Integer usgId;
	
	@Id
	@Column(name="UGP_ID")
	private Integer ugpId;
	
	@Column(name="USP_TITLE")
	private String title;
	
	@Column(name="USP_FNAME")
	private String uspFname;
	
	@Column(name="USP_LNAME")
	private String uspLname;

	@Column(name="USP_MNAME")
	private String uspMname;
	
	@Column(name="USG_NAME")
	private String usgName;
	
	@Column(name="USP_STATUS")
	private String uspStatus;
	
	@Column(name="USP_USER_NAME")
	private String uspUserName;
	
	@Column(name="USP_PASSWORD")
	private String uspPassword;
	
	
	//Add 2010-09-21
	@Column(name="USP_FORCE_CHNG_PWD_FLAG")
	private String uspForceChngPwdFlag;
	
	@Column(name="USP_LAST_ACCESS_DATE")
	private Timestamp uspLastAccessDate;
	
	@Column(name="USP_MOBILE_NO")
	private String uspMobileNo;
	
	@Column(name="USP_TEL_NO")
	private String uspTelNo;
	
	@Column(name="USP_WRONG_LOGIN_COUNTER")
	private short uspWrongLoginCounter;
	
	@Column(name="USP_EMAIL")
	private String uspEmail;

	@Column(name="USP_EXPIRE_DATE")
	private Timestamp uspExpireDate;
	
	@Column(name="USP_LOCK_FLAG")
	private String uspLockFlag;
	
	//Extended Fields
	@Transient
	private String group;
	
	public Integer getUspId() {
		return uspId;
	}

	public void setUspId(Integer uspId) {
		this.uspId = uspId;
	}

	public Integer getUsgId() {
		return usgId;
	}

	public void setUsgId(Integer usgId) {
		this.usgId = usgId;
	}

	public String getUspFname() {
		return uspFname;
	}

	public void setUspFname(String uspFname) {
		this.uspFname = uspFname;
	}

	public String getUspLname() {
		return uspLname;
	}

	public void setUspLname(String uspLname) {
		this.uspLname = uspLname;
	}

	public String getUspMname() {
		return uspMname;
	}

	public void setUspMname(String uspMname) {
		this.uspMname = uspMname;
	}

	public String getUsgName() {
		return usgName;
	}

	public void setUsgName(String usgName) {
		this.usgName = usgName;
	}
	
	public Integer getUgpId() {
		return ugpId;
	}

	public void setUgpId(Integer ugpId) {
		this.ugpId = ugpId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUspUserName() {
		return uspUserName;
	}

	public void setUspUserName(String uspUserName) {
		this.uspUserName = uspUserName;
	}

	public String getUspPassword() {
		return uspPassword;
	}

	public void setUspPassword(String uspPassword) {
		this.uspPassword = uspPassword;
	}

	public String getUspStatus() {
		return uspStatus;
	}

	public void setUspStatus(String uspStatus) {
		this.uspStatus = uspStatus;
	}

	public String getUspForceChngPwdFlag() {
		return uspForceChngPwdFlag;
	}

	public void setUspForceChngPwdFlag(String uspForceChngPwdFlag) {
		this.uspForceChngPwdFlag = uspForceChngPwdFlag;
	}

	public Timestamp getUspLastAccessDate() {
		return uspLastAccessDate;
	}

	public String getUspLastAccessDateFormatted() {
		return CommonUtil.date2StrFormat(this.uspLastAccessDate, "dd/MM/yyyy HH:mm:sss");
	}

	public void setUspLastAccessDate(Timestamp uspLastAccessDate) {
		this.uspLastAccessDate = uspLastAccessDate;
	}

	public String getUspMobileNo() {
		return uspMobileNo;
	}

	public void setUspMobileNo(String uspMobileNo) {
		this.uspMobileNo = uspMobileNo;
	}

	public String getUspTelNo() {
		return uspTelNo;
	}

	public void setUspTelNo(String uspTelNo) {
		this.uspTelNo = uspTelNo;
	}

	public short getUspWrongLoginCounter() {
		return uspWrongLoginCounter;
	}

	public void setUspWrongLoginCounter(short uspWrongLoginCounter) {
		this.uspWrongLoginCounter = uspWrongLoginCounter;
	}

	public String getUspEmail() {
		return uspEmail;
	}

	public void setUspEmail(String uspEmail) {
		this.uspEmail = uspEmail;
	}

	public Timestamp getUspExpireDate() {
		return uspExpireDate;
	}
	
	public String getUspExpireDateFormatted() {
		return CommonUtil.date2StrFormat(uspExpireDate, "dd/MM/yyyy HH:mm:sss");
	}

	public void setUspExpireDate(Timestamp uspExpireDate) {
		this.uspExpireDate = uspExpireDate;
	}

	public String getUspLockFlag() {
		return uspLockFlag;
	}

	public void setUspLockFlag(String uspLockFlag) {
		this.uspLockFlag = uspLockFlag;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

}
